#pragma once
#include "Game/Process/RenderProcess.h"
#include "Render/Tradition/ComputePipeline.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"
#include "../LocalEntity.h"
#include "../LocalShader.h"
#include "../ResourceProcess.h"
#include "../LocalScene.h"

class DdgiRayTraceProcess;

class DdgiBorderUpdateProcess : public RenderProcess
{
	DECLARE_PROCESS(DdgiBorderUpdateProcess)

public:


protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:

	LocalScene* mLocalScene;

	ResourceProcess* mResourceProcess;

	DdgiRayTraceProcess* mDdgiRayTraceProcess;



	std::array<RefCountPtr<RHITexture>, 2> mIrradianceImage;

	std::array<RefCountPtr<RHITexture>, 2> mDepthImage;



	RefCountPtr<RHIDescriptor> mIrradianceDescriptor;

	RefCountPtr<RHIDescriptor> mDepthDescriptor;

	std::array<DescriptorMask, 2> mMultiDescriptorMask;



	RefCountPtr<ComputePipeline> mIrradiancePipeline;

	RefCountPtr<ComputePipeline> mDepthPipeline;




	RefCountPtr<RHICommandBuffer> mCommandBuffer;

	RefCountPtr<RHISemaphore> mWaitGraphicsSemaphore;

	RefCountPtr<RHISemaphore> mSignalComputeSemaphore;

};
